package cn.getech.data.metadata.model.res.log;

import cn.getech.data.metadata.entity.meta.CollectionTableInfo;
import com.google.common.collect.Lists;
import lombok.Data;

import java.util.List;


@Data
public class TableLog {

    /**
     * 表名称
     */
    private String tableName;
    /**
     * 表别名
     */
    private String tableAlias;
    /**
     *表数据量
     */
    private Long rowsNum;
    /**
     * 表大小
     */
    private Double totalSize;

    private List<FieldLog> addFieldList= Lists.newArrayList();
    private List<FieldLog> updateFieldList= Lists.newArrayList();
    private List<FieldLog> deleteFieldList= Lists.newArrayList();
    public TableLog(){

    }
    public TableLog(CollectionTableInfo table) {
        if (table != null) {
            this.tableName=table.getTableName();
            this.tableAlias=table.getTableAlias();
            this.rowsNum=table.getRowsNum();
            this.totalSize=table.getTotalSize();
        }
    }
}
